package cn.bdqn.utils.result;

/**
 * 统一API响应结果封装
 * @author dkj
 */
public class Result<T> {
    /**
     * //错误信息编码
     */
    private int code;
    /**
     *  //消息
     */
    private String message;
    /**
     * //数据
     */
    private T data;
    /**
     * //总数
     */
    private int count;

    public Result setCode(ResultCode resultCode) {
        this.code = resultCode.code();
        return this;
    }

    public int getCode() {
        return code;
    }

    public int getCount() {
        return count;
    }

    public String getMessage() {
        return message;
    }

    public Result setMessage(String message) {
        this.message = message;
        return this;
    }

    public Result setCount(int count) {
        this.count = count;
        return this;
    }

    public T getData() {
        return data;
    }

    public Result setData(T data) {
        this.data = data;
        return this;
    }


}
